Skip to content

feat(voice-line): step 1 — push-to-talk DO, Whisper STT + MeloTTS out, VAD trim, Turso ledger (#9800) - #10039

Merged
dezren39 merged 1 commit into
mainfrom
queue/16482-9800-voice-line
Nov 15, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16482-9800-voice-line

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Step 1 of the basement voice line for #9800 (task 16482) — code complete; deploy + live voice proof remain (account-side), tracked on the issue.

New package pm-stack/voice-line-worker (follows the decision-events-worker conventions):

  • src/session.ts — VoiceSession Durable Object: push-to-talk WebSocket (PCM16LE 16 kHz streamed while the button is held, {"type":"stop"} to process). One DO per session id.
  • src/vad.ts — energy VAD + silence trim: head/tail cut, long internal pauses collapsed. Only trimmed audio is submitted to transcription — silence is never billed (Workers AI charges per submitted minute) and never transcribed. Pure + unit-tested.
  • STT: Workers AI Whisper (@cf/openai/whisper-large-v3-turbo) via the AI binding, called directly.
  • TTS: Workers AI MeloTTS (@cf/myshell-ai/melotts) speaks the answer back in the same session — Drew's 2026-11-14 amendment ("it must talk back"); OpenCode: Whisper STT + TTS as routed pool models — failover, proxying, silence auto-trim #9801 stays the pooled/failover companion and is not built here.
  • src/intent.ts — the one read-only intent: queue state, answered from the newest Turso status_snapshots row (fleet pushes snapshots via the token-guarded POST /ingest-status). No write actions over voice; anything else gets a spoken explanation of the capability.
  • src/ledger.ts — Turso session ledger over the libsql HTTP pipeline (no SDK): session id, timestamps, transcript, intent, answer, audio seconds in (post-trim) and out, both model ids. Schema created idempotently.
  • src/index.ts — routes (/, /ws, /health, /ingest-status) + the push-to-talk page (MediaRecorder-free: ScriptProcessor PCM capture, plays the spoken answer).
  • wrangler.toml — AI binding, DO binding + migration; TURSO_URL is a var placeholder, TURSO_TOKEN / STATUS_INGEST_TOKEN are secrets (README documents the one-time setup).

Verification (laptop, this branch): bun test 9/9 (VAD trim/collapse/all-silence + intent matching/answers), bunx tsc --noEmit clean. No live deploy yet: creating the Turso database, setting the two secrets, and wrangler deploy are account-side steps listed in the README, after which the acceptance proof is one spoken queue-state question with its row visible in the ledger.

Refs #9800 (does not close it — the live end-to-end voice proof is the remaining acceptance item).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…, VAD trim, Turso ledger (#9800)

New pm-stack/voice-line-worker (task 16482): VoiceSession Durable
Object serving a push-to-talk WebSocket; PCM16 audio is VAD-trimmed
(head/tail cut, long pauses collapsed) and only trimmed audio is
submitted to Workers AI Whisper; the one read-only intent (queue
state, from fleet-pushed Turso snapshots) is answered in text and
spoken back via MeloTTS per Drews 2026-11-14 talk-back amendment;
every utterance writes a Turso session-ledger row (transcript,
intent, answer, audio seconds in/out). bun test 9/9, tsc clean.
Deploy (Turso DB + secrets + wrangler deploy) and the live voice
proof remain — see README deploy section.
@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 14:14
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9fc04816-83f6-41df-9ae8-4d7e1d5050bf
Commits

Reviewing files that changed from the base of the PR and between 2c2adb9 and 9667eeb.

Files ignored due to path filters: 1

  • pm-stack/voice-line-worker/bun.lock is excluded by !**/*.lock
Files selected for processing: 11

  • pm-stack/voice-line-worker/README.md
  • pm-stack/voice-line-worker/package.json
  • pm-stack/voice-line-worker/src/index.ts
  • pm-stack/voice-line-worker/src/intent.ts
  • pm-stack/voice-line-worker/src/ledger.ts
  • pm-stack/voice-line-worker/src/session.ts
  • pm-stack/voice-line-worker/src/vad.ts
  • pm-stack/voice-line-worker/test/intent.test.ts
  • pm-stack/voice-line-worker/test/vad.test.ts
  • pm-stack/voice-line-worker/tsconfig.json
  • pm-stack/voice-line-worker/wrangler.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T14:14:52.197749Z
We couldn’t complete this review. Comment @codex review to try again.
9667eeb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · picked up — task 17366 (pr_shepherd: merge PR #10039)

@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 15, 2026
@dezren39
dezren39 merged commit bf26fb7 into main Nov 15, 2026
1 check passed
@dezren39
dezren39 deleted the queue/16482-9800-voice-line branch November 15, 2026 16:24
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · done — task 17366: PR #10039 MERGED

@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 15, 2026
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant